package ldh.im.fxbase.data.pojo.status;

import ldh.rpc.dto.ValueEnum;

public enum ImSessionStatus implements ValueEnum<Byte> {
    created(0, "刚创建"),  // 刚创建
    enable(1, "可用"),
    disable(2, "不可用"),
    ;

    private Byte value;
    private String desc;

    private ImSessionStatus(Integer value, String desc){
        this.value = value.byteValue();
        this.desc = desc;
    }

    @Override
    public Byte getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static ImSessionStatus getByValue(Integer value) {
        if (value == null) return null;
        for (ImSessionStatus groupStatus : ImSessionStatus.values()) {
            if (groupStatus.getValue() == value.byteValue()) {
                return groupStatus;
            }
        }

        throw new RuntimeException("ImSessionStatus不支持这个值：" + value);
    }

}
